package my.test.bean.ex5;



import java.util.Properties;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
	@Test
	public void test1(){
		ApplicationContext ctx = new MyClassPathXmlApplicationContext("my/test/bean/ex5/applicationContext.xml");
		//ApplicationContext ctx = new ClassPathXmlApplicationContext("my/test/bean/ex5/applicationContext.xml");
		MyTest test = (MyTest)ctx.getBean("test");
		test.testAware();
	}

	@Test
	public void test2() {
		Properties properties = System.getProperties();
		properties.setProperty("VAR", "su");
//		System.setProperty("VAR","su");
		ApplicationContext ctx = new MyClassPathXmlApplicationContext("my/test/bean/ex5/applicationContext.xml");
		MyTest test = (MyTest)ctx.getBean("test");
		test.testAware();
	}
}
